< previous page page_844 next page >

Page 844
Type.gifListing 21.42. Coding the SetForm method.
Public Sub SetForm()
    '
    ' set up form controls
    '
    '
    Me.Caption = "Security Test Form"
    '
    lblPrompt(0).Caption = "Author ID"
    lblPrompt(1).Caption = "Name"
    lblPrompt(2).Caption = "DOB"
    '
    txtField(0).DataField = "AUID"
    txtField(1).DataField = "Name"
    txtField(2).DataField = "DOB"
    '
    Data1.BOFAction = vbMoveFirst
    Data1.EOFAction = vbMoveLast
    Data1.DatabaseName = App.Path & "\..\..\data\books5.mdb"
    Data1.RecordSource = "Authors"
    Data1.Refresh
    '
End Sub
The SetLog method simply initializes the logObject and sets its properties in preparation for writing audit log entries (see Listing 21.43).
Type.gifListing 21.43. Coding the SetLog method.
Public Sub SetLog()
    '
    ' setup logging
    '
    Set objLog = New logObject
    objLog.filename = App.Path & "\" & App.EXEName & ".log"
    objLog.LogHeader = App.EXEName & " Audit Log"
    '
End Sub
Finally, the SetUser method initializes the user object, then lets the user login. If the login is successful, the row of command buttons is enabled, based on the user's rights for each item (see Listing 21.44).

 
< previous page page_844 next page >

If you like this book, buy it!